import request from '@/utils/request'

// 查询邮件模版库列表
export function listEmailtemplate(query) {
  return request({
    url: '/email/emailtemplate/list',
    method: 'get',
    params: query
  })
}

// 查询邮件模版库列表 (别名)
export function listEmailTemplate(query) {
  return listEmailtemplate(query)
}

// 查询邮件模版库详细
export function getEmailtemplate(id) {
  return request({
    url: '/email/emailtemplate/' + id,
    method: 'get'
  })
}

// 新增邮件模版库
export function addEmailtemplate(data) {
  return request({
    url: '/email/emailtemplate',
    method: 'post',
    data: data
  })
}

// 修改邮件模版库
export function updateEmailtemplate(data) {
  return request({
    url: '/email/emailtemplate',
    method: 'put',
    data: data
  })
}

// 删除邮件模版库
export function delEmailtemplate(id) {
  return request({
    url: '/email/emailtemplate/' + id,
    method: 'delete'
  })
}

export function changemailtemplateStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/email/emailtemplate/changeStatus',
    method: 'put',
    data: data
  })
}
